<%-- 
    Document   : gererprojets
    Created on : 28 févr. 2012, 11:36:43
    Author     : tidiane
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
            <link rel ="stylesheet" type ="text/css" href = "libs/bootstrap/css/bootstrap.css" />
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js">
            </script>
            <link rel = "icon" href = "media/images/favicon.ico"/>
            <script type = "text/javascript" src = "http://twitter.github.com/bootstrap/assets/js/bootstrap-modal.js" ></script>
            <script type = "text/javascript">
                $(document).ready(function (){
                    $('#save-affectation').click(function (){
                        if ( $('#collaborateur').val() != "" && $('#role').val() != "") {
                            $('#faire-collaborateur').submit();
                        }
                        else 
                            alert (" Collaborateur et/ou rôle manque(ent) ");
                    })
                })
                
            </script>
    </head>
    <body>
        <div id="creerprojets" >
        <div class="modal-header">
            <a class="close" data-dismiss="modal" >&times;</a>
            <h3>
                Affectation d'un collabrateur au projet 
            </h3>
        </div>
        <div class="modal-body" >
            <form id ="faire-collaborateur" method = "POST" action = "affecter-collaborateur" class="form-horizontal">
                <fieldset>
                    <input type = "hidden" value = "${projet.idProjet}" name = "pid"/>
                    <div class = "control-group">
                        <label class="control-label" for="projet"> Projet </label>
                        <div class="controls">
                            <input class = "input-xlarge uneditable-input" type = "text" value = "${projet.titre}">
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label" for="collaborateur"> Collaborateur </label>
                        <div class="controls">
                            <select name = "collaborateur" id = "collaborateur">
                                <c:forEach var = "collaborateur" items = "${collaborateurs}">
                                    <option value = "${collaborateur.login}">${collaborateur.login}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label" for="role"> Rôle du collaborateur </label>
                        <div class="controls">
                            <select name = "role" id = "role">
                                <c:forEach var = "role" items = "${roles}">
                                    <option value = "${role.role}">${role.role}</option>
                                </c:forEach>
                            </select>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
        <div class ="modal-footer">
            <input id = "save-affectation" class ="btn btn-primary"type = "button" value = "Enregister">
        </div>
        </div>
    <body>
</html>